package com.aidex.baseinfo.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.BaseEntity;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.baseinfo.mapper.BaseSupplierMapper;
import com.aidex.baseinfo.domain.BaseSupplier;
import com.aidex.baseinfo.service.BaseSupplierService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 供应商信息Service业务层处理
 * @author cq
 * @email 382425530@qq.com
 * @date 2023-06-20
 */
@Service
@Transactional(readOnly = true)
public class BaseSupplierServiceImpl extends BaseServiceImpl<BaseSupplierMapper, BaseSupplier> implements BaseSupplierService {

    private static final Logger log = LoggerFactory.getLogger(BaseSupplierServiceImpl.class);

    /**
     * 获取单条数据
     * @param baseSupplier 供应商信息
     * @return 供应商信息
     */
    @Override
    public BaseSupplier get(BaseSupplier baseSupplier) {
        BaseSupplier dto = super.get(baseSupplier);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 供应商信息id
     * @return 供应商信息
     */
    @Override
    public BaseSupplier get(String id) {
        BaseSupplier dto = super.get(id);
        return dto;
    }

    /**
     * 查询供应商信息列表
     * @param baseSupplier 供应商信息
     * @return 供应商信息
     */
    @Override
    public List<BaseSupplier> findList(BaseSupplier baseSupplier) {
		List<BaseSupplier> baseSupplierList = super.findList(baseSupplier);
        return baseSupplierList;
    }

    /**
     * 分页查询供应商信息列表
     * @param baseSupplier 供应商信息
     * @return 供应商信息
     */
    @Override
    public PageInfo<BaseSupplier> findPage(BaseSupplier baseSupplier) {
		PageInfo<BaseSupplier> page = super.findPage(baseSupplier);
        return page;
    }

    /**
     * 保存供应商信息
     * @param baseSupplier
     * @return 结果
     */
    @Override
    public boolean save(BaseSupplier baseSupplier) {
        return super.save(baseSupplier);
    }

    /**
     * 删除供应商信息信息
     * @param baseSupplier
     * @return 结果
     */
    @Override
    public boolean remove(BaseSupplier baseSupplier) {
        return super.remove(baseSupplier);
    }

    /**
     * 批量删除供应商信息
     * @param ids 需要删除的供应商信息ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBaseSupplierByIds(String[] ids) {
        return mapper.deleteBaseSupplierByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

}
